package response

type Response struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

func Success(data any) Response {
	return Response{
		Code: 0000,
		Msg:  "success",
		Data: data}
}

func SuccessWithMsg(data any, msg string) Response {
	return Response{
		Code: 0000,
		Msg:  msg,
		Data: data}
}

func Fail(msg string) Response {
	return Response{Code: 0001,
		Msg:  msg,
		Data: nil}

}
